const equipmentInfo = 'equipmentInfo'
const repairid = 'repairid'
const userInfo = 'userInfo'

/**
 *  获取设备状态
 */
export function getInfoSync() {
	return uni.getStorageSync(equipmentInfo);
}
/**
 *  获取维修单状态
 */
export function getRpIdSync() {
	return uni.getStorageSync(repairid);
}

/**
 *  获取用户基本信息
 */
export function getUserInfoSync() {
	return uni.getStorageSync(userInfo);
}




/**
 * 本地存储用户信息
 */
export function setUserInfoSync(state) {
	return uni.setStorageSync(userInfo, JSON.stringify(state));
}


/**
 * 本地存储设备状态
 */
export function setInfoSync(state) {
	console.log(JSON.stringify(state))
	return uni.setStorageSync(equipmentInfo, JSON.stringify(state));
}

/**
 * 本地维修id单状态
 */
export function setRpIdSync(id) {
	console.log(JSON.stringify(id))
	return uni.setStorageSync(repairid, JSON.stringify(id));
}




/**
 * 异步删除状态
 */
export function removeInfo() {
	return uni.removeStorage({
		key: equipmentInfo,
		success: function(res) {
			console.log('删除equipmentInfo success');
			console.log(res.data);
		}
	});
}
/**
 * 异步维修单id删除状态
 */
export function removeRpId() {
	return uni.removeStorage({
		key: repairid,
		success: function(res) {
			console.log('删除repairid success');
			console.log(res.data);
		}
	});
}

/**
 * 删除状态
 */
export function removeInfoSync() {
	return uni.removeStorageSync(equipmentInfo)	
}
/**
 * 删除状态
 */
export function removeRpIdSync() {
	return uni.removeStorageSync(repairid)	
}


/**
 * 删除用户信息
 */
export function removeUserInfoSync() {
	return uni.removeStorageSync(userInfo)	
}


